import axios from 'axios';
import BaseURL from './api';

export default class CourseService {
    static async getCourses() {
        const res = await axios.get(
            BaseURL+'/courses'
        )
        return res;
    }
    static async getCourse(data) {
        const res = await axios.get(
            BaseURL + '/course',
            { params: data }
        )
        return res;
    }
    static async createCourse(data) {
        const res = await axios.post(
            BaseURL+'/courses/new/',
            data
        )
        return res;
    }
    static async getStudents(data) {
        const res = await axios.post(
            BaseURL + '/courses/students',
            data
        );
        return res;
    } 
    static async updateAbout(data) {
        const res = await axios.put(
            BaseURL + '/course',
            data
        );
        return res;
    }
    static async subscribe(data) {
        const res = await axios.post(
            BaseURL + '/course/subscribe',
            data
        );
        return res;
    }
    static async isSubscribe(data) {
        const res = await axios.post(
            BaseURL + '/course/issubscribe',
            data
        );
        return res;
    }
}
